package main

import "fmt"

func main() {
	//var ranks map[string]int
	ranks := make(map[string]int)
	ranks["gold"] = 1
	ranks["silver"] = 2
	ranks["bronze"] = 3
	fmt.Println(ranks["gold"])
	fmt.Println(ranks)
	elements := map[string]string{"a": "1", "b": "2"}
	fmt.Println(elements)
	value, ok := elements["a"]
	fmt.Println(value, ok)
	status("li4")
	status("wang5")
	delete(elements, "a")
	fmt.Println(elements)
}

func status(name string) {
	grades := map[string]float64{"zhang3": 0, "li4": 86.5}
	grade, ok := grades[name]
	if !ok {
		fmt.Printf("No grade recorded for %s.\n", name)
	} else if grade < 60 {
		fmt.Printf("%s is failing!\n", name)
	}
}
